<!--{include admin/top.html}-->
	<div class="mainPage">
	<!--{if $act == 'list'}-->
		<h1 class="title">页面列表
			<span class='sub_menu'>
				&nbsp; <a href="{:parse_uri('admin_page-add')}">添加页面</a>
			</span>
		</h1>
		<table width="100%" align=center cellspacing=0 cellpadding=0 border=0>
		<tr >
			<td width="15%"><p><b>页面名称</b></p></td>
			<td width="35%"><p><b>链接地址</b></p></td>
			<td width="15%"><p><b>导航显示</b></p></td>
			<td width="15%"><p><b>页面类型</b></p></td>
			<td width="20%"><p><b>操作</b></p></td>
		</tr>
		<!--{foreach $pages $k $v}-->
		<tr class='ctr' style="line-height:30px;">
			<td style="padding:4px;"><p>{$v['name']}</td>
			<td><p>
				<!--{if $v['ptype'] == '0'}-->
					{:parse_uri('page-%d',$v['Id'])}
				<!--{else}-->
					{$v['url']}
				<!--{/if}--></p>
			</td>
			<td><p>
				<!--{if $v['is_nav'] == '1'}-->
				<span style="color:green">是</span>
				<!--{else}-->
				<span style="color:gray">否</span>
				<!--{/if}--></p>
			</td>
			<td><p>
				<!--{if $v['ptype'] == '0'}-->
					<span style="color:green">站内</span>
				<!--{else}-->
					<span style="color:gray">站外</span>
				<!--{/if}--></p>
			</td>
			<td> <p>
			<a href="{:parse_uri('admin_page-modify-id-%d',$v['Id'])}">修改</a> | 
			<a href="{:parse_uri('admin_page-del-id-%d',$v['Id'])}">删除</a></p> </td>
		</tr>
		<!--{/foreach}-->
		</table>
	<!--{else if $act == 'modify'|$act == 'add'}-->
		<script>
			function showPanel(val){
				if(val==1){
					$("#content_panel").hide();
					$("#link_url").show();
				}else{
					$("#content_panel").show();
					$("#link_url").hide();
				}
			}
			$(document).ready(function(){
				{if $page['ptype']== '1'}
					$("#content_panel").hide();
					$("#link_url").show();
				{else}
					$("#content_panel").show();
					$("#link_url").hide();
				{/if}
			});
		</script>
		<h1 class="title">
		<!--{if $act == 'modify'}-->
		{$page['name']} 管理
		<!--{else}-->
		添加新页面
		<!--{/if}-->
		<span class='sub_menu'>
			&nbsp; <a href="{:parse_uri('admin_page')}">返回列表</a>
		</span>
		</h1>
		<form action="{:parse_uri('admin_page-save')}" method="post">
		<p class='ctr' style='line-height:30px;'>页面名称: <input name="name" value="{$page['name']}" class='ipt' /></p>
		<p class='ctr' style='line-height:30px;'>导航显示: <input name="is_nav" type="checkbox"  {if $page['is_nav'] == '1'}checked{/if}  value="1" /></p>
		<p class='ctr' style='line-height:30px;'>页面类型: 
			站内 <input type="radio" name='ptype' value='0' {if $page['ptype'] == '0'}checked{/if}
			{if !isset($page['ptype'])}checked{/if} onclick="showPanel(0)" />
			站外 <input type="radio" name='ptype' value='1' {if $page['ptype'] == '1'}checked{/if} onclick="showPanel(1)" />
		</p>
		<p class='ctr' id='link_url' style='line-height:30px;display:none'>链接地址: <input name="url" value="{$page['url']}" /></p>
		<div id='content_panel' style="display:none">
		<p class='ctr'  style='line-height:30px;'>页面内容
		<textarea name="content" style="display:none">{$page['content']}</textarea>
		</p>
		<p><iframe ID="Editor" name="Editor" src="{themes}/Editor/index.html?ID=content" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:320px;width:600px"></iframe></p>
		</div>
		<p class='ctr'  style='margin-top:10px;'><input type="submit" value='提交'class="submit"/></p>
		
		<input type="hidden" name="page_id" value="{$page['Id']}"  />
		<input type="hidden" name="content_id" value="{$page['content_id']}"  />
		</form>
	<!--{/if}-->
	<p>&nbsp;</p>
	</div>
</body>
</html>